import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import TypeNav from '@/components/TypeNav'
import CopyRight from '@/components/CopyRight'
import store from '@/store'
import '@/mock/mockServer'
import "swiper/css/swiper.min.css";
import MySwiper from '@/components/MySwiper'
import Pagination from '@/components/Pagination'
import * as API from '@/api'

// 使用element-ui
import {MessageBox,Message,Button} from 'element-ui';
// 两种写法都可以
Vue.component(Button.name, Button);
// Vue.use(Button)
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$message = Message;



// import {reqCategoryList} from '@/api'
// reqCategoryList()
// import '@/api'

// 全局注册组件
Vue.component('TypeNav',TypeNav)
Vue.component('CopyRight',CopyRight)
Vue.component('MySwiper',MySwiper)
Vue.component('Pagination',Pagination)

Vue.config.productionTip = false

new Vue({
  beforeCreate(){
    Vue.prototype.$bus = this;//安装全局总线
    Vue.prototype.$API = API;
  },
  router,
  store,
  render: h => h(App),
}).$mount('#app')
